public class Fibonac {
    final int n;
    Fibonac(int n){
        this.n = n;
    }
    public int getN(){
        return this.n;
    }
    protected Integer compute(){
//        System.out.println(Thread.currentThread().getId()+" doing..." );
        if(n<=1)
            return n;
        Fibonac f1 = new Fibonac(n-1);
        Fibonac f2 = new Fibonac(n-2);
        System.out.println(Thread.currentThread().getId()+" doing..."+f1.getN()+"...."+f2.getN() );
        return f1.compute() + f2.compute();
    }
}
